home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / hypertxt / hyper2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  3.7 KB  |  146 lines

  1. VERSION 2.00
  2. Begin Form MainForm 
  3.    Caption         =   "Index"
  4.    ClientHeight    =   5700
  5.    ClientLeft      =   435
  6.    ClientTop       =   1515
  7.    ClientWidth     =   8025
  8.    Height          =   6105
  9.    Left            =   375
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form2"
  12.    ScaleHeight     =   5700
  13.    ScaleWidth      =   8025
  14.    Top             =   1170
  15.    Width           =   8145
  16.    Begin CommandButton ListGoto 
  17.       Caption         =   "Goto"
  18.       Height          =   465
  19.       Left            =   4050
  20.       TabIndex        =   6
  21.       Top             =   5100
  22.       Width           =   3765
  23.    End
  24.    Begin CommandButton FOpen 
  25.       Caption         =   "Open"
  26.       Height          =   465
  27.       Left            =   150
  28.       TabIndex        =   3
  29.       Top             =   5100
  30.       Width           =   3615
  31.    End
  32.    Begin FileListBox File1 
  33.       Height          =   1980
  34.       Left            =   150
  35.       Pattern         =   "*.hyp"
  36.       TabIndex        =   2
  37.       Top             =   2850
  38.       Width           =   3615
  39.    End
  40.    Begin ListBox List1 
  41.       Height          =   3735
  42.       Left            =   4050
  43.       Sorted          =   -1  'True
  44.       TabIndex        =   5
  45.       Top             =   900
  46.       Width           =   3765
  47.    End
  48.    Begin DirListBox Dir1 
  49.       Height          =   1815
  50.       Left            =   150
  51.       TabIndex        =   1
  52.       Top             =   750
  53.       Width           =   3615
  54.    End
  55.    Begin DriveListBox Drive1 
  56.       Height          =   360
  57.       Left            =   150
  58.       TabIndex        =   0
  59.       Top             =   150
  60.       Width           =   3615
  61.    End
  62.    Begin Label HyperName 
  63.       FontBold        =   -1  'True
  64.       FontItalic      =   0   'False
  65.       FontName        =   "MS Sans Serif"
  66.       FontSize        =   13.5
  67.       FontStrikethru  =   0   'False
  68.       FontUnderline   =   0   'False
  69.       Height          =   615
  70.       Left            =   4050
  71.       TabIndex        =   4
  72.       Top             =   150
  73.       Width           =   3765
  74.    End
  75. Sub Check1_Click ()
  76. End Sub
  77. Sub Dir1_Change ()
  78. File1.Path = Dir1.Path
  79. File1.SetFocus
  80. If File1.ListCount Then
  81.  File1.ListIndex = 0
  82. End If
  83. End Sub
  84. Sub Drive1_Change ()
  85. Dir1.Path = Drive1.Drive
  86. End Sub
  87. Sub File1_DblClick ()
  88.  FOpen_Click
  89. End Sub
  90. Sub FOpen_Click ()
  91.  ChDrive Drive1.Drive
  92.  ChDir File1.Path
  93.  Open File1.FileName For Input As #1
  94.  Line Input #1, HName$
  95.  HyperName.caption = HName$
  96.  'make sure list is empty in case the one we're
  97.  'loading isn't the first.
  98.  Do While List1.ListCount
  99.   List1.RemoveItem 0
  100.  Loop
  101.  On Error GoTo BadData
  102.  c = 0
  103.   c = c + 1
  104.   NUMTOPICS = c
  105.   Line Input #1, TOPIC$(c)
  106.   List1.AddItem TOPIC$(c)
  107.   Line Input #1, KW$
  108.   CC = 0
  109.   Do While KW$ <> Chr$(34)' a quote
  110.    CC = CC + 1
  111.    KEYWORD$(c, CC) = KW$
  112.    Line Input #1, KW$
  113.   Loop
  114.   Line Input #1, Txt$
  115.   TOPTEXT$(c) = ""
  116.   Do While Txt$ <> Chr$(34)' a quote
  117.    TOPTEXT$(c) = TOPTEXT$(c) + Txt$ + Chr$(13) + Chr$(10)
  118.    Line Input #1, Txt$
  119.   Loop
  120.  Loop Until EOF(1)
  121.  Close #1
  122.  On Error Resume Next
  123.  Exit Sub
  124. BadData:
  125.  Rpt$ = "Error at or before Topic" + Str$(c) + " (" + TOPIC$(c) + ")"
  126.  MsgBox Rpt$, 16, ".HYP File Format Error"
  127. End Sub
  128. Sub Form_Unload (Cancel As Integer)
  129. End Sub
  130. Sub List1_DblClick ()
  131.  ListGoto_Click
  132. End Sub
  133. Sub ListGoto_Click ()
  134.  For c = 1 To NUMTOPICS
  135.   If TOPIC$(c) = List1.text Then
  136.    BackNdx = 0
  137.    BackUp(BackNdx + 1) = c
  138.    cardform.Show
  139.    cardform.label1.caption = TOPIC$(c)
  140.    cardform.text1.text = TOPTEXT$(c)
  141.    cardform.text1.selstart = 64000'end of text
  142.    mainform.Hide
  143.   End If
  144.  Next
  145. End Sub
  146.